#!/usr/bin/env python
# coding: utf-8

# 详见
from cloud_server.ali_dns_domain import AliyunDNS
AliyunDNS().ali_dns_get_list('Domain')
# Detailed in Up

from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.acs_exception.exceptions import ClientException
from aliyunsdkcore.acs_exception.exceptions import ServerException
from aliyunsdkalidns.request.v20150109.DescribeDomainRecordsRequest import DescribeDomainRecordsRequest
from cloud_server import Ali_DNS_AccessKeyID, Ali_DNS_AccessKeySecret
import json

client = AcsClient(Ali_DNS_AccessKeyID, Ali_DNS_AccessKeySecret, 'cn-hangzhou')

request = DescribeDomainRecordsRequest()
request.set_accept_format('json')

request.set_DomainName("leecq.xyz")

response = client.do_action_with_exception(request)
# python2:  print(response)
# print(str(response, encoding='utf-8'))
res = str(response, encoding='utf-8')

res = json.loads(res)["DomainRecords"]["Record"]
